package temp;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;

public class TAsd {
    public static void main(String[] args) {
        System.out.println(new TAsd().unique_string("assdjs"));

        List<String> ans  = new ArrayList<>();
        ans.sort((o1, o2) -> {
            if(o1.length()==o2.length()){
               return o1.compareTo(o2);
            }else{
                return o1.length()-o2.length();
            }
        });
        ans.get(0);
    }

    public String unique_string (String s) {
        // write code here
        StringBuilder sb = new StringBuilder();
        int[] hash = new int[26];
        for(int i =0;i<s.length();i++){
            char a = s.charAt(i);
            if((hash[a-'a']) ==0){
                sb.append(a);
                hash[a-'a']=1;
            }
        }
        return sb.toString();
    }
}
